package efg.tasks;

import efg.SelfCheckableTask;
import efg.Train;

public class StoppingShedule extends SelfCheckableTask {
	
	Train train;
	
	public StoppingShedule(Train train) {
		assert(train != null);
		this.train = train;
	}

	@Override
	public Boolean canExecute() {
		return train.getCurrentAccel() <= 0 ;
	}

	@Override
	public void execute(Integer currentTime) {
		train.scheduleStopTime(currentTime);
	}

}
